import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class demo10 {

    public static void main(String[] args) {
        try(InputStream inputStream = new FileInputStream("./text.txt");){
            while(true){
                int b = inputStream.read();
                if (b == -1){
                    break;
                }
                System.out.printf("0x%x\n",b);
                //频繁读取多次硬盘,当前硬盘的IO耗时是比较大的
            }
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
